package com.nulldev.util.web.HttpServer3.extensions.nCaptcha.captchas.v4.proposal_d;

import com.nulldev.util.VariableAPI.RandomUtil;
import com.nulldev.util.data.Sets.DataSet;
import com.nulldev.util.web.HttpServer3.extensions.nCaptcha.backend.Captcha;
import com.nulldev.util.web.HttpServer3.extensions.nCaptcha.backend.user.User;
import com.nulldev.util.web.HttpServer3.extensions.nCaptcha.backend.user.UserInfoType;
import com.nulldev.util.web.HttpServer3.extensions.nCaptcha.backend.user.UserManager;
import com.nulldev.util.web.HttpServer3.pages.v3.HttpPage3.Request;

public class GryoscopeChallengePlaceholderChallenge implements Captcha {

	private static final String BLANK_TRANSPARENT_PLACEHOLDER = "";
	private static final String[] BLANK_STRING_ARRAY = new String[0];
	private static final DataSet<String, String[]> DATA_SET_PLACEHOLDER = new DataSet<String, String[]>(BLANK_TRANSPARENT_PLACEHOLDER, BLANK_STRING_ARRAY);

	@Override
	public DataSet<String, String[]> generateBase64Image(final int botLevel, final Request request) {
		final float posX = RandomUtil.randFloat(-0.1f, 1);
		final float posY = RandomUtil.randFloat(-0.1f, 1);
		final float posZ = RandomUtil.randFloat(-0.1f, 1);
		final User user = UserManager.loadUser(request.ip());
		user.putUserInfo(UserInfoType.USER_INFO_V4_GRYO_CHALLENGE_POS_X, posX);
		user.putUserInfo(UserInfoType.USER_INFO_V4_GRYO_CHALLENGE_POS_Y, posY);
		user.putUserInfo(UserInfoType.USER_INFO_V4_GRYO_CHALLENGE_POS_Z, posZ);
		return DATA_SET_PLACEHOLDER;
	}

	@Override
	public String getType() {
		return "v4-gryo";
	}

}
